#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_err.h"
#include "esp_log.h"
#include "user_include.h"

#define WIFI_TASK_PRIO              3
#define LED_TASK_PRIO              0

const char *TAG = "main";
void app_main(void)
{

    /* Initialize file storage */
    const char* base_path = "/data";
    ESP_ERROR_CHECK(example_mount_storage(base_path));

    xTaskCreatePinnedToCore(user_wifi_task, "WIFI", 8192, NULL, WIFI_TASK_PRIO, NULL, tskNO_AFFINITY);
    xTaskCreatePinnedToCore(user_led_task, "LED", 8192, NULL, LED_TASK_PRIO, NULL, tskNO_AFFINITY);

    /* Start the file server */
    ESP_ERROR_CHECK(example_start_file_server(base_path));
    ESP_LOGI(TAG, "File server started");

    while(1)
    {
    	ESP_LOGI(TAG, "File server ota running");
    	vTaskDelay(100);
    }
}
